/*
 * queue.h
 *
 *  Created on: 2015-5-15
 *      Author: likui
 */

#ifndef QUEUE_H_
#define QUEUE_H_

#include <stdbool.h>
#include "http_conn.h"

typedef http_conn_t * ELEMTYPE;

typedef struct queue_t {
	int		elems_len;					// 队列元素长度
	ELEMTYPE *elems;					// 队列元素指针
	int		front;						// 队列首部
	int		rear;						// 队列尾部
}queue_t;

bool queue_init(queue_t *queue, int queue_size);
void queue_destroy(queue_t *queue);
bool queue_is_full(queue_t *queue);
bool queue_is_empty(queue_t *queue);
bool queue_add(queue_t *queue, ELEMTYPE elem);
ELEMTYPE queue_del(queue_t *queue);
void queue_print(queue_t *queue);

#endif /* QUEUE_H_ */
